#ifndef DOCUMENT_H
#define DOCUMENT_H

#include <QObject>
#include <QSqlDatabase>
#include <QtSql>
#include <QSqlQuery>
#include <QSqlTableModel>
#include <QModelIndex>
 #include <QHash>

class DocumentRow : public QObject
{
public:
    explicit DocumentRow(QObject *parent = 0);
    int ID;
    int product;
    int qty;
    double price;
    double amount;
};

class Document : public QObject
{
    Q_OBJECT
public:
    explicit Document(QObject *parent = 0);
    void setvalue( int id = 0, int t = 0, int n = 0, int c = 0, QDate d = QDate::currentDate (), int s = 0);
    int ID;
    int type;
    int number;
    int client;
    QDate date;
    bool payed;
    bool closed;
    double total;
    QHash<int, DocumentRow*> rows;
    void changeRow(int id,int product,int qty,double price);

private:

signals:

public slots:

};


#endif // DOCUMENT_H
